<?php

class Default_AdminAction extends ProjectBaseAction
{	
	public function executeWrite(AgaviRequestDataHolder $rd)
	{
		$user = $this->getContext()->getUser();
		$login = $user->login($rd->getParameter("name"),$rd->getParameter("password"));
		if ($login==true)
		{
			return 'Success';
		}
		else
		{
			return 'Error';
		}
	}
	
	public function executeRead(AgaviRequestDataHolder $rd)
	{
		$user = $this->getContext()->getUser();
		if($user->isAuthenticated()) {
			return 'Success';
		}
		return 'Form';
	}
	
	public function getDefaultViewName()
	{
		return 'Form';
	}
}

?>